import multiprocessing
print("启动这个必须是放在main函数里面，如果不是就会失败！！！")

from utils_times import print_now



def analysis_process():
    pass

def work_process():
    pass

def test_event():
    input_queue = multiprocessing.Queue()
    ouput_queue = multiprocessing.Queue()
    wait_event = multiprocessing.Event()
    stop_event = multiprocessing.Event()

    print_now()
    wait_event.clear()
    print(wait_event.wait(5))
    print_now()
    wait_event.set()
    print(wait_event.wait())
    wait_event.clear()
    print(wait_event.is_set())

def create_work_process_group():
    input_queue = multiprocessing.Queue()
    ouput_queue = multiprocessing.Queue()
    wait_event = multiprocessing.Event()
    stop_event = multiprocessing.Event()

    dosomething = multiprocessing.Process(target=work_process, args=(input_queue, ouput_queue, wait_event, stop_event))
    dosomething.start()

    analysissomething = multiprocessing.Process(target=analysis_process, args=(ouput_queue, input_queue, stop_event))
    analysissomething.start()

    return dosomething, analysissomething


if __name__ == '__main__':
    try:
        pass
    except KeyboardInterrupt:
        pass
    except Exception as e:
        print(e)
    finally:
        pass